package com.rpp.demo.controller;

import com.rpp.demo.entity.User;
import com.rpp.demo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Description
 * @Author rpp
 * @Date 2020/11/29 6:50 下午
 */
@RestController
@RequestMapping(value = "/user")
public class TestController {

    @Autowired
    UserService userService;

    @GetMapping(value = "/test")
    public String test() {
        return "test hot";
    }

    @GetMapping(value = "/list")
    public List<User> getUserList() {
        return userService.findAll();
    }
}
